<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /* var x = 1;
        var obj = {
            f:function() {
                console.log(this.x);
            },
            x: 2         
        }
        obj.f();
        var f1 = obj.f;
        f1(); */
        function sum1(n, m) {
            if (n > m) {
                n = n + m;
                m = n - m;
                n = n - m;
            }
            
            var count = 0;
            for (var i = n; i <= m; i++){
                count += i;
            }

            return count;
        }
        var re = sum1(3, 7);
        console.log(re);
    </script>
</body>
</html>